//
//  Types.hpp
//  WiFiMACSim
//
//  Created by Christopher Kemsley on 3/31/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#ifndef WiFiMACSim_Types_hpp
#define WiFiMACSim_Types_hpp

#include <map>
#include <set>
#include <string>

#define	SimNamespaceBegin	namespace Sim {
#define SimNamespaceEnd		}



SimNamespaceBegin


typedef	unsigned		UInteger ;
static UInteger const	UIntegerMax	=	((UInteger)(-1)) ;





typedef char	ID ;

struct	IDSet
{
	ID*			mBegin ;
	ID*			mEnd ;
	UInteger	mCount ;
	
	IDSet () ;
	~IDSet () ;
	
	void add ( ID const & id ) ;
	
	inline bool	contains ( ID const & inID ) const
		{
		ID * h = mBegin ;
		while ( h < mEnd )
			{
			if ( (*h) == inID ) return true ;
			h ++ ;
			}
		return false ;
		}
} ;

struct	IDSetMap
{
	IDSetMap () ;
	~IDSetMap () ;
	
	IDSet	mMap [256] ;
	
	IDSet& operator[] ( ID const & inID )
		{
		return mMap[inID] ;
		}
} ;



SimNamespaceEnd








#define		SymbolToCString(symbol)		#symbol




#define	PreMainInitializer(name,codeScope) \
\
struct name { name () { codeScope } ~name(){} } ; name _##name ;






#endif
